var param = {}, formId = 'queryForm', url = "/openx/order/orderCsoLogService/queryForPage";

(function () {
    /**进行表格数据初始化*/
    var data = $.openx.getJsonObj(formId);
    param.csoLog = data;
    $.openx.initTable("table", url, param);
})();

//查询按钮触发
$.openx.query = function () {
    var data = $.openx.getJsonObj(formId);
    param.csoLog = data;
    $.openx.tableRefresh(url, param);
}

function resetForm(){
    $('#queryForm')[0].reset();
    $('#channelSelectsId').val(null).trigger('change');
    var data = $.openx.getJsonObj(formId);
    param.csoLog = data;
    $.openx.initTable("table", url +"?t="+new Date().getTime(), param);
    //$.openx.query();
}


function formatTime(value, row) {
    return $.openx.formatDate(new Date(value));
}

function formatUserCode(value, row) {
    return row.operateUserCode+"("+row.operateUserName+")";
}
function formatStatus(value, row) {
	return row.status==1?"未处理完成":"处理完成";
}
function formatResult(value, row) {
	if(row.result){
        if(row.result.length>20){
            return "<a id='"+row.id+"' onclick='showAll(" + JSON.stringify(row)+ ");'>"+row.result.substring(0,20)+"\n..."+"</a>";
        }else{
            return row.result;
        }
    }
    return "-";
}

function showAll(row){
    layer.tips(row.result, '#table a[id="'+row.id+'"]', {
        tips: [4, '#78BA32'],
        area: ['auto', 'auto']
      });
}